version: "2"

services:
  scylladb:
    image: scylladb/scylla
    ports:
      - 9180:9180
      - 9100:9100
      - 9160:9160
      - 9042:9042
    volumes:
      - ./docker-data/scylladb:/var/lib/scylla
    command: "--experimental 1"
  rabbitmq:
    image: rabbitmq:3
    environment:
      RABBITMQ_DEFAULT_USER: admin
      RABBITMQ_DEFAULT_PASS: admin
    ports:
      - 5672:5672
      - 15672:15672
  php:
    image: twaketech/twake-php
    volumes:
      - ./configuration/backend/:/configuration/
      - ./docker-data/drive/:/twake-core/drive/
      - ./docker-data/drive-preview/:/twake-core/web/medias/
      - ./docker-data/uploads/:/twake-core/web/upload/
    depends_on:
      - rabbitmq
      - scylladb
      - elasticsearch
    links:
      - websockets
      - scylladb
  websockets:
    image: twaketech/twake-websockets
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.4.3
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./docker-data/es_twake:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
  nginx:
    image: twaketech/twake-nginx
    ports:
      - 8000:80
    links:
      - php
      - websockets
    volumes_from:
      - php
    volumes:
      - ./configuration/frontend/:/configuration
      - ./docker-data/logs/nginx/:/var/log/nginx
      - ./docker-data/drive-preview/:/twake-core/web/medias/
      - ./docker-data/uploads/:/twake-core/web/upload/
